home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.lang.pl1,comp.lang.c
- Subject: Re: PL/I and C
- Date: Wed, 28 Feb 96 12:55:14 GMT
- Organization: none
- Message-ID: <825512114snz@genesis.demon.co.uk>
- References: <4gh5ru$eng@goanna.cs.rmit.EDU.AU> <AD536AAB9668B76CD@mcdialb09.it.luc.edu> <312E363C.3CDE@corp.dialog.com> <TANMOY.96Feb23212936@qcd.lanl.gov> <4h0gn2$mnk@wizvax.wizvax.net>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <4h0gn2$mnk@wizvax.wizvax.net>
- multics@wizvax.wizvax.net "Richard Shetron" writes:
-
- >In article <TANMOY.96Feb23212936@qcd.lanl.gov>,
- >Tanmoy Bhattacharya <tanmoy@qcd.lanl.gov> wrote:
-
- >>Are you claiming that
- >> union { int x;
- >> char y[4]; } z;
- >>is invalid C? Why?
- >
- >Is that int x a long int or a short int?
-
- Neither. It is an int. long and short are different types.
-
- >Last I knew the size of an int was compiler dependent.
-
- The size of all of the integer types is compiler dependent. However that
- doesn't affect the validity of the example unless it is a requirement that
- the char array is the same size (which it isn't in the language). If you
- wanted that you could write:
-
- union { int x;
- char y[sizeof(int)]; } z;
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-